/// @description 创建View
// You can write your code in this editor

//自适应屏幕
/*
var w = window_get_width();
var h = window_get_height();

view_set_wport(view_current, 640);
view_set_hport(view_current, 640*h/w);

camera_set_view_size(view_get_camera(view_current), 640, 640*h/w);
*/

#region 菜单页面
//创建view
page_root = sai_scrViewNew(noone, sai_oView, x, y);
page_root.view_show = false;
page_root.view_width = view_wport[0];
page_root.view_height = view_hport[0];

//生成菜单
var btn = sai_scrViewNew(page_root, sai_oButton, page_root.view_width/2-64*3/2, page_root.view_height-400);
btn.view_width = 64*3;
btn.view_height = 64*3/2;
btn.view_id = 100;
btn.text = "开始游戏";
btn.view_btn_onClick = scr_menu_btnOnClick;
	
btn = sai_scrViewNew(page_root, sai_oButton, page_root.view_width/2-64*3/2, page_root.view_height-300);
btn.view_width = 64*3;
btn.view_height = 64*3/2;
btn.view_id = 101;
btn.text = "地图编辑";
btn.view_btn_onClick = scr_menu_btnOnClick;
	
btn = sai_scrViewNew(page_root, sai_oButton, page_root.view_width/2-64*3/2, page_root.view_height-200);
btn.view_width = 64*3;
btn.view_height = 64*3/2;
btn.view_id = 102;
btn.text = "退出游戏";
btn.view_btn_onClick = scr_menu_btnOnClick;

//创建进度条
jindu = sai_scrViewNew(noone, sai_oProgressBar, 20, page_root.view_height-100);
jindu.view_clear_bkg = true;
jindu.view_is_gui = true;
jindu.view_width = page_root.view_width-40;
jindu.view_height = 40;
jindu.progress = 0;

//开启倒计时
alarm[0] = 4;
#endregion

